package Control;

import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

import Entity.MsgPackage;
import GUI.FrozenReqManagGui;
import GUI.ScreenManager;

public class FrozenReqManagControl {

	private FrozenReqManagGui frozenManagGui;
	private MsgPackage frozManageMsg;
	private String data;
	
	public FrozenReqManagControl(){
		frozenManagGui = new FrozenReqManagGui();
		frozManageMsg= new MsgPackage();
	}
	
	public FrozenReqManagGui getFrozenManagGui(){
		return frozenManagGui;
	}
	
	public boolean frozenReqManagment_pressed(){
		String x =data= (String) frozenManagGui.getReqNum().getSelectedItem();
		if(x==null){
			JOptionPane.showMessageDialog(null, "Not all the fileds all the fill", "ERROR", JOptionPane.ERROR_MESSAGE);
			return false;
		}
		
		frozManageMsg.setObject(data);
		frozManageMsg.setOp_code(OP_CODE.FROZEN_MANAGMENT);
		ScreenManager.getConnection().accept(frozManageMsg);
		JOptionPane.showMessageDialog(null, "The request has been frozen successfully", "", JOptionPane.INFORMATION_MESSAGE);
		return true;
	}
}
